<template>
	<view class="classify-layout pageBg">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="content">
			<theme-item v-for="item in classifyList" :key="item._id" :item="item"></theme-item>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,onMounted
	} from 'vue';
	import {getClassifyAPI} from '@/api/api.js';
	import {onShareTimeline,onShareAppMessage} from '@dcloudio/uni-app';
	const classifyList = ref([]);
	const getClassify = async () => {
		let res = await getClassifyAPI({pageSize:15});
		classifyList.value = res.data
	}
	onMounted(()=>{
		getClassify();
	})
	
	
	//分享给好友
	onShareAppMessage((e)=>{
		return {
			title:"咸虾米壁纸，好看的手机壁纸",
			path:"/pages/classify/classify"
		}
	})
	
	//分享朋友圈
	onShareTimeline(()=>{
		return {
			title:"咸虾米壁纸，好看的手机壁纸"
		}
	})
</script>

<style lang="scss" scoped>
	.classify-layout {
		.content {
			padding: 30rpx;
			display: grid;
			gap: 15rpx;
			grid-template-columns: repeat(3,1fr);
		}
	}       
</style>
